package com.shujia.java.day8.demo3;

//继承
public class Dog extends Animals {
    private String variety;//种类
    public Dog() {
    }

    public Dog(String name, int age, String color, String variety) {
        super(name, age, color);
        this.variety = variety;
    }
    public String getVariety() {
        return variety;
    }
    public void setVariety(String variety) {
        this.variety = variety;
    }
    //捉老鼠
    public void play(){
        System.out.println("狗在捉老鼠");
    }

    @Override
    public void eat() {
        System.out.println("一只叫"+super.getName()+"的"+variety+"在吃饭");
    }
//    public void eat(String play) {
//        System.out.println("一只叫"+super.getName()+"的"+variety+"在用"+play+"吃饭");
//    }
//    public void eat(String play,String play1) {
//        System.out.println("一只叫"+super.getName()+"的"+variety+"在用"+play+play1+"吃饭");
//    }
}
